package day09API.serialize;

import java.io.Serializable;

/**
 * @author DBX
 * @effect 序列化
 * @date 2021/8/27 0027 - 10:02
 */
public class User implements Serializable {
    private String name;
    private String password;
    private int age;
//    被transient修饰的属性在进行序列化的时候自动忽略
    private transient String nickname;

    public User(String name, String password, int age, String nickname) {
        this.name = name;
        this.password = password;
        this.age = age;
        this.nickname = nickname;
    }

    public User() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                ", nickname='" + nickname + '\'' +
                '}';
    }

}
